﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Model
{
    /// <summary>
    /// 入库单页面显示实体
    /// </summary>
    public class WhInbound
    {
        [Key]
        public long StockOrderId { get; set; }
        public string StockOrderNo { get; set; }
        public string StockType { get; set; }
        public string OrderStatus { get; set; }
        public DateTime StockDate { get; set; }
        public string WarehouseName { get; set; }
        public string UpOrderNo {  get; set; }
        public string AllGoodsName { get; set; }
        public string OperatorBy {  get; set; }
        public decimal AllOrderQuantity { get; set; }
        public decimal PurchaseUnitPriceCount { get; set; }
        public string CreateBy { get; set; }
        public string CreateOrgName { get; set; }
        public DateTime CreateTime { get; set; }
        public string AuditorBy { get; set; }
        public DateTime AuditorTime { get; set; }
    }

    /// <summary>
    /// 仓库选择用实体
    /// </summary>
    public class WareHouseDTO
    {
        [Key]
        public long WareHouseId { get; set; }
        public string WarehouseName { get; set; }
    }

    /// <summary>
    /// 入库单查询条件实体
    /// </summary>
    public class WhInbSelectWithSth
    {
        public string StockOrderNo { get; set; }
        public string StockType { get; set; }
        public string OrderStatus { get; set; }
        public long WarehouseId { get; set; }
    }

    /// <summary>
    /// 关联进货单号详细信息实体
    /// </summary>
    public class OmPurchaseOrderSourceDetail
    {
        [Key]
        public long UpOrderId { get; set; }
        public string UpOrderNo { get; set; }
        public string OrderStatus { get; set; }
        public DateTime BuyerDate { get; set; }
        public long SupplierId { get; set; }
        public string SupplierName { get; set; }
        public string BuyerOrgName { get; set; }
        public string UsersName { get; set; }
        public string ContactPerson { get; set; }
        public string ContactPhone { get; set; }
        public decimal PurchaseUnitPrice { get; set; }
        public decimal OrderQuantity { get; set; }
        public decimal ReceivedQuantity { get; set; }
        public decimal UnstockedQuantity { get; set; }
    }

    /// <summary>
    /// 多条件查询关联进货单号
    /// </summary>
    public class WhInSelectWithSth
    {
        //进货单号
        public string UpOrderNo { get; set; }
        //单据状态
        public string OrderStatus { get; set; }
        //供应商ID
        public long SupplierId { get; set; }
        //进货人ID
        public long BuyerId { get; set; }
        //进货部门ID
        public long BuyerOrgId { get; set; }
        //进货日期
        public DateTime OmPurDate { get; set; }
    }

    /// <summary>
    /// 进货订单商品信息实体
    /// </summary>
    public class OmPurOrderGoodsDetail
    {
        //货品ID
        public long UpOrderId { get; set; }
        //货品编号
        public string GoodsCode { get; set; }
        //货品名称
        public string GoodsName { get; set; }
        //规格型号
        public string Specification { get; set; }
        //货品类型
        public string GoodsTypeName { get; set; }
        //进货单价
        public decimal PurchaseUnitPrice { get; set; }
        //进货数量
        public decimal OrderQuantity { get; set; }
        //进货总金额
        public decimal PurchaseUnitCount { get; set; }
        //已入库数量
        public decimal ReceivedQuantity { get; set; }
        //未入库数量
        public decimal NonPurchaseQuantity { get; set; }
        //当前库存
        public decimal AvailableInventoryQty { get; set; }
        //进货日期
        public DateTime BuyerDate { get; set; }
        //供应商名称
        public string SupplierName { get; set; }
    }

    /// <summary>
    /// 查询仓库及库位的综合实体用于选择库位和查询库位容量
    /// </summary>
    public class WhLocationSelect
    {
        //仓库ID
        public long WarehouseId { get; set; }
        //仓库名称
        public string WareHouseName { get; set; }
        //库位ID
        public long StorageLocationId { get; set; }
        //库位名称
        public string StorageLocationName { get; set; }
        //库位容量
        public decimal StorageLocationCapacity { get; set; }
        //库位已用库存
        public decimal TotalAvailableInventory { get; set; }
    }

    /// <summary>
    /// 入库单添加实体
    /// </summary>
    public class WhInboundForAdd
    {
        //仓库Id
        public long WareHouseId { get; set; }
        //入库单号
        public string StockOrderNo {  get; set; }
        //关联单号
        public string SourceOrderNo { get; set; }
        //入库日期
        public DateTime StockDate { get; set; }
        //入库类型
        public string StockType { get; set; }
        //经办人
        public long OperatorBy { get; set; }
        //经办时间
        public DateTime OperatorDate { get; set; }
    }
}
